package com.shiwaixiangcun.monitor.domain;


import com.rabbit.spring.data.domain.BaseEntity;
import com.shiwaixiangcun.core.domain.Dictionary;
import com.shiwaixiangcun.monitor.enums.DeviceBrand;
import com.shiwaixiangcun.monitor.enums.DeviceType;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;


@Entity
@Table(name = "ms_device")
@DynamicUpdate
@DynamicInsert
public class Device extends BaseEntity<Long> {
    private String number;   //讯铃设备呼叫器编号(或者接收器编号)
    //高德地图坐标
    private String longitude; //经度
    private String latitude;  //纬度
    private String name;   //设备别名

    @ManyToOne
    @JoinColumn(name = "model_id")
    private Dictionary model;   //设备型号

    @Enumerated(EnumType.STRING)
    private DeviceType deviceType;//设备类型

    @Enumerated(EnumType.STRING)
    private DeviceBrand deviceBrand;//设备品牌

    private Long belongToReceiver; //属于哪个接收器(呼叫器才有该值，这里的ID值指向Device表的ID)

    public static final String MODEL_TYPE = "10003";


    public Device() {
    }

    public Long getBelongToReceiver() {
        return belongToReceiver;
    }

    public void setBelongToReceiver(Long belongToReceiver) {
        this.belongToReceiver = belongToReceiver;
    }

    public Dictionary getModel() {
        return model;
    }

    public void setModel(Dictionary model) {
        this.model = model;
    }

    public DeviceType getDeviceType() {
        return deviceType;
    }

    public void setDeviceType(DeviceType deviceType) {
        this.deviceType = deviceType;
    }

    public DeviceBrand getDeviceBrand() {
        return deviceBrand;
    }

    public void setDeviceBrand(DeviceBrand deviceBrand) {
        this.deviceBrand = deviceBrand;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public String getLongitude() {
        return longitude;
    }

    public void setLongitude(String longitude) {
        this.longitude = longitude;
    }

    public String getLatitude() {
        return latitude;
    }

    public void setLatitude(String latitude) {
        this.latitude = latitude;
    }
}
